﻿namespace MicroCloud.SMS.Entities
{
    /// <summary>
    /// 实体类：验证码短信记录基类 
    /// </summary>
    /// <typeparam name="TKey">验证码短信记录主键类型</typeparam>
    [EventEntityIgnore]
    public abstract class VerifyCodeBase<TKey> : EntityBase<TKey>, ICreatedTime
        where TKey : IEquatable<TKey>
    {
        #region 属性
        #region "获取或设置 服务提供商"
        /// <summary>
        /// 获取或设置 服务提供商
        /// </summary>
        [Column("Provider")]
        [DisplayName("服务提供商")]
        public SmsProvider Provider { get; set; }
        #endregion
        #region "获取或设置 短信签名名称"
        private string _SignName = "";
        /// <summary>
        /// 获取或设置 短信签名名称
        /// </summary>
        [Column("SignName")]
        [StringSize(StringSizeType.Code)]
        [DisplayName("短信签名名称")]
        public string SignName { get { return _SignName; } set { _SignName = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 短信模板ID"
        private string _TemplateCode = "";
        /// <summary>
        /// 获取或设置 短信模板ID
        /// </summary>
        [Column("TemplateCode")]
        [StringSize(StringSizeType.Code)]
        [DisplayName("短信模板ID")]
        public string TemplateCode { get { return _TemplateCode; } set { _TemplateCode = value.ReplaceNull(); } }
        #endregion

        #region "获取或设置 发送回执ID"
        private string _BizId = "";
        /// <summary>
        /// 获取或设置 发送回执ID
        /// </summary>
        [Column("BizId")]
        [StringSize(StringSizeType.Code)]
        [DisplayName("发送回执ID")]
        public string BizId { get { return _BizId; } set { _BizId = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 请求ID"
        private string _RequestId = "";
        /// <summary>
        /// 获取或设置 请求ID
        /// </summary>
        [Column("RequestId")]
        [StringSize(StringSizeType.Code)]
        [DisplayName("请求ID")]
        public string RequestId { get { return _RequestId; } set { _RequestId = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 外部流水扩展字段"
        private string _OutId = "";
        /// <summary>
        /// 获取或设置 外部流水扩展字段
        /// </summary>
        [Column("OutId")]
        [StringSize(StringSizeType.Code)]
        [DisplayName("外部流水扩展字段")]
        public string OutId { get { return _OutId; } set { _OutId = value.ReplaceNull(); } }
        #endregion

        #region "获取或设置 手机号码"
        private string _PhoneNumber = "";
        /// <summary>
        /// 获取或设置 手机号码
        /// </summary>
        [Column("PhoneNumber")]
        [Required, DefaultValue("")]
        [StringSize(StringSizeType.Key)]
        [DisplayName("手机号码")]
        [MobileNumber]
        public string PhoneNumber { get { return _PhoneNumber; } set { _PhoneNumber = value.ReplaceNull(); } }
        #endregion

        #region "获取或设置 发送日期"
        /// <summary>
        /// 获取或设置 发送日期
        /// </summary>
        [Column("SendDate")]
        [DisplayName("发送日期")]
        public DateTime SendDate { get; set; }
        #endregion
        #region "获取或设置 接收日期"
        /// <summary>
        /// 获取或设置 接收日期
        /// </summary>
        [Column("ReceiveDate")]
        [DisplayName("接收日期")]
        public DateTime ReceiveDate { get; set; }
        #endregion

        #region "获取或设置 信息内容"
        private string _Message = "";
        /// <summary>
        /// 获取或设置 信息内容
        /// </summary>
        [Column("Message")]
        [Required, DefaultValue("")]
        [StringSize(StringSizeType.General)]
        [DisplayName("信息内容")]
        public string Message { get { return _Message; } set { _Message = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 验证码"
        private string _VerifyCode = "";
        /// <summary>
        /// 获取或设置 验证码
        /// </summary>
        [Column("VerifyCode")]
        [Required, DefaultValue("")]
        [StringSize(StringSizeType.Key)]
        [DisplayName("验证码")]
        public string VerifyCode { get { return _VerifyCode; } set { _VerifyCode = value.ReplaceNull(); } }
        #endregion

        #region "获取或设置 有效期分钟数"
        /// <summary>
        /// 获取或设置 有效期分钟数
        /// </summary>
        [Column("ExpireMins")]
        [DisplayName("有效期分钟数")]
        public decimal ExpireMins { get; set; }
        #endregion
        #region "获取或设置 是否已验证"
        /// <summary>
        /// 获取或设置 是否已验证
        /// </summary>
        [Column("Verified")]
        [DisplayName("已验证")]
        public bool Verified { get; set; }
        #endregion
        #region "获取或设置 验证时间"
        /// <summary>
        /// 获取或设置 验证时间
        /// </summary>
        [Column("VerifiedTime")]
        [DisplayName("验证时间")]
        public DateTime? VerifiedTime { get; set; }
        #endregion

        #region "获取或设置 创建时间 ICreatedTime、ICreationAudited  可装载接口，在数据创建时可自动设置当前时间"
        /// <summary>
        /// 获取或设置 创建时间
        /// </summary>
        [Column("CreatedTime")]
        [DisplayName("创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #endregion

    }

}
